using System;
using System.Collections;

namespace Snooze.Controllers.Flex
{
    using Castle.MonoRail.Framework;
    using Snooze.Model;

	public abstract class FlexController : SmartDispatcherController
	{

        [AjaxAction]
        protected void FindAll(string typeName)
        {
            Hashtable h = new Hashtable();
            h.Add("typeName", typeName);

            // TODO: find a solution for this hack
            if (Environment.OSVersion.Platform.ToString() == "Unix")
            {
                // on linux it must be the same case as in the view directory
                // pretty understandable
                Redirect("", "dal", "findall", h);
            }
            else
            {
                // but on windows it MUST be the case of the
                // controller/function case
                // Otherwise the redirect simple is not working in SOME(!) cases
                Redirect("", "DAL", "FindAll", h);
            }
        }

	}
}
